package com.walleipt.demo.transitionManager;

import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

@Repository
public class UserDao {

	@Autowired
	JdbcTemplate jdbcTemplate ;
	
	@Transactional
	public void add() {
		
		String uuIdstr = UUID.randomUUID().toString().substring(8);
		jdbcTemplate.update("insert into `user`(name,age) values(?,?)",uuIdstr,24) ;
		System.err.println("插入完成！");
			
		System.err.println( 12/0 );
	}
}
